19. Notebook + 练习:多重共线性与 VIF

Workspace

This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: jupyter
  • Opened files (when workspace is loaded): n/a

根据第一个问题的散点图矩阵,观察下列说法,选出所有正确选项。

SOLUTION:
  • 看起来自变量彼此相关。
  • 看起来最相关的变量是卧室数和浴室数。

观察你的多元线性回归模型,请选出所有有关模型系数的正确说法。

SOLUTION:
  • 随着浴室数增加,我们预测房价会上升。
  • 随着住宅面积的增加,我们预测房价会上升

根据 VIF,下列哪些说法所讲的操作是正确的?

SOLUTION: 因为卧室和浴室变量的 VIF 都大于 10,所以我们应该删除卧室或浴室。

根据最终结果,勾选下列所有正确的说法。

SOLUTION:
  • 现在所有 VIF 都小于 10。
  • 正如我们所预料的,现在所有系数都是正值了。
  • 决定系数有两个数位保持不变,意味着模型里并不需要卧室和浴室同时存在。